﻿<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
 
    <script type='text/html' template> 
        <input type='hidden' name='PID' value="{{ d.params.PID || '' }}"/>
    </script>    
    <div class='layui-form-item'>
        <label class='layui-form-label'>订单ID </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template lay-done='layui.data.getSelSource(d.params,"OrderID_SelSource");'>
                    <select name='OrderID_SelSource' id='OrderID_SelSource' lay-search></select>
                </script>
            </div>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>发货单号</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='DeliveyNumber' value='{{ d.params.DeliveyNumber || '' }}' lay-verify='required' placeholder='发货单号' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>    
    <div class='layui-form-item'>
        <label class='layui-form-label'>下单人 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template lay-done='layui.data.getSelSource(d.params,"User_SelSource");'>
                    <select name='User_SelSource' id='User_SelSource' lay-search></select>
                </script>
            </div>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>发货类型 [0.邮寄发货|1.自提发货|2.核销发货|3.其他发货]</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='DeliverType' value='{{ d.params.DeliverType || '' }}' lay-verify='required|number' placeholder='发货类型 [0.邮寄发货|1.自提发货|2.核销发货|3.其他发货]' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>发货终端 [0.网点|1.供应商]</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='TagEnd' value='{{ d.params.TagEnd || '' }}' lay-verify='required|number' placeholder='发货终端 [0.网点|1.供应商]' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>发货终端ID (店铺ID或供应商ID)</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='TagEndID' value='{{ d.params.TagEndID || '' }}' lay-verify='required' placeholder='发货终端ID (店铺ID或供应商ID)' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>    
    <div class='layui-form-item'>
        <label class='layui-form-label'>发货人 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template lay-done='layui.data.getSelSource(d.params,"SendUser_SelSource");'>
                    <select name='SendUser_SelSource' id='SendUser_SelSource' lay-search></select>
                </script>
            </div>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>发货时间</label>
        <div class='layui-input-inline'>
            <script type='text/html' template  lay-done='layui.data.datedone(d.params);'>
                <input type='text' name='DeliverTime' readonly='readonly' id='DeliverTime' value='{{ d.params.DeliverTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>订单支付金额</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='OrderPrice' value='{{ d.params.OrderPrice || '' }}' lay-verify='required' placeholder='订单支付金额' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>订单配送方式 [1.快递|2.自提]</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='DistributionMode' value='{{ d.params.DistributionMode || '' }}' lay-verify='required|number' placeholder='订单配送方式 [1.快递|2.自提]' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>发货单状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select name='State_Sel'>                      <option value='0' {{ d.params.State_Sel == '0' ? 'selected' : '' }}>待发货1</option>                      <option value='2' {{ d.params.State_Sel == '2' ? 'selected' : '' }}>取消发货</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
         
    <div class='layui-form-item'>
        <label class='layui-form-label'>物流状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select name='ExpressState_Sel'>                      <option value='0' {{ d.params.ExpressState_Sel == '0' ? 'selected' : '' }}>未发货</option>                      <option value='1' {{ d.params.ExpressState_Sel == '1' ? 'selected' : '' }}>已发货</option>                      <option value='2' {{ d.params.ExpressState_Sel == '2' ? 'selected' : '' }}>待签收</option>                      <option value='3' {{ d.params.ExpressState_Sel == '3' ? 'selected' : '' }}>已签收</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>排序</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='Sort' value='{{ d.params.Sort || '' }}' lay-verify='required|number' placeholder='排序' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系人</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='UserName' value='{{ d.params.UserName || '' }}' lay-verify='required' placeholder='联系人' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系单位</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='UserCompany' value='{{ d.params.UserCompany || '' }}' lay-verify='required' placeholder='联系单位' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系电话</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='UserTel' value='{{ d.params.UserTel || '' }}' lay-verify='required' placeholder='联系电话' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系地址</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='UserAddress' value='{{ d.params.UserAddress || '' }}' lay-verify='required' placeholder='联系地址' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>快递单号</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='ExpressNumber' value='{{ d.params.ExpressNumber || '' }}' lay-verify='required' placeholder='快递单号' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>快递公司</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='ExpressName' value='{{ d.params.ExpressName || '' }}' lay-verify='required' placeholder='快递公司' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>快递公司编码</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='ExpressCode' value='{{ d.params.ExpressCode || '' }}' lay-verify='required' placeholder='快递公司编码' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>备注</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='RMK' value='{{ d.params.RMK || '' }}' lay-verify='required' placeholder='备注' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>商品数据 (检索)</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='GoodsData' value='{{ d.params.GoodsData || '' }}' lay-verify='required' placeholder='商品数据 (检索)' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>商品ID集合 (检索)</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='GoodIds' value='{{ d.params.GoodIds || '' }}' lay-verify='required' placeholder='商品ID集合 (检索)' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>商品分类ID集合 (检索)</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='GoodCateIds' value='{{ d.params.GoodCateIds || '' }}' lay-verify='required' placeholder='商品分类ID集合 (检索)' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>扩展1</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='Extend1' value='{{ d.params.Extend1 || '' }}' lay-verify='required' placeholder='扩展1' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>扩展2</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='Extend2' value='{{ d.params.Extend2 || '' }}' lay-verify='required' placeholder='扩展2' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>扩展3</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='Extend3' value='{{ d.params.Extend3 || '' }}' lay-verify='required' placeholder='扩展3' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>邮政发货单号</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='waybill_no' value='{{ d.params.waybill_no || '' }}' lay-verify='required' placeholder='邮政发货单号' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div> 
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" value="确认" class="layui-btn">
        </div>
    </div>
</div>

<script type="text/javascript"> 
    layui.use(['form','admin','upload','laydate'], function () {
        var form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
    });
    
    layui.data.getSelSource = function (d,sourceName) { 
         layui.use(['admin','form'], function () {
                var $ = layui.$;
                var form = layui.form;
                var admin = layui.admin;
    
            if (sourceName == "OrderID_SelSource") {
                admin.req({
                    url: layui.setter.APIUrl + '/shop/orderMgr/customerQuery', //实际使用请改成服务端真实接口
                    type: 'post',
                    done: function (res) {
                        //$("#OrderID_SelSource").append("<option value=''>全部</option>");
                        layui.each(res.Data, function (index, eachdata) {
                            var strIsSel = '';
                            if (eachdata.PID == d.OrderID_SelSource)
                                strIsSel = "selected='selected'";
                            $("#OrderID_SelSource").append("<option value='" + eachdata.PID + "' " + strIsSel + ">" + eachdata.OrderNumber + "</option>");
                        });
                        form.render('select');
                    }
                }); 
            }
            if (sourceName == "User_SelSource") {
                admin.req({
                    url: layui.setter.APIUrl + '/admin/userMgr/customerQuery', //实际使用请改成服务端真实接口
                    type: 'post',
                    done: function (res) {
                        //$("#User_SelSource").append("<option value=''>全部</option>");
                        layui.each(res.Data, function (index, eachdata) {
                            var strIsSel = '';
                            if (eachdata.PID == d.User_SelSource)
                                strIsSel = "selected='selected'";
                            $("#User_SelSource").append("<option value='" + eachdata.PID + "' " + strIsSel + ">" + eachdata.UserName + "</option>");
                        });
                        form.render('select');
                    }
                }); 
            }
            if (sourceName == "SendUser_SelSource") {
                admin.req({
                    url: layui.setter.APIUrl + '/admin/userMgr/customerQuery', //实际使用请改成服务端真实接口
                    type: 'post',
                    done: function (res) {
                        //$("#SendUser_SelSource").append("<option value=''>全部</option>");
                        layui.each(res.Data, function (index, eachdata) {
                            var strIsSel = '';
                            if (eachdata.PID == d.SendUser_SelSource)
                                strIsSel = "selected='selected'";
                            $("#SendUser_SelSource").append("<option value='" + eachdata.PID + "' " + strIsSel + ">" + eachdata.UserName + "</option>");
                        });
                        form.render('select');
                    }
                }); 
            } 
        });
    }
 
     
    layui.data.setUpload = function (d) { 
        layui.use(['upload','admin'], function () {
                var $ = layui.$,
                upload = layui.upload,
                admin = layui.admin;
                var formSelects = layui.formSelects;
      
        });
    }

    
    layui.data.datedone = function (d) { 
        layui.use(['laydate'], function () {
                var laydate = layui.laydate;
    
            //日期时间选择器
            laydate.render({
                elem: '#DeliverTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.DeliverTime;
 
        });
    }   
</script>
